<?php defined('_JEXEC') or die('Restricted access'); ?>
<form action="index.php?option=com_articlecashrewards" method="post" name="adminForm">
<table class="nowshow" cellspacing="1" width="100%">
    <tr>
        <td>
            <fieldset class="adminform">
            <legend><?php echo JText::_( 'TOOLTIP_REVIEW_WEBLINK' ); ?></legend>
            <table class="admintable">
                <tr>
                    <td class="key">
                        <?php echo JText::_('LABEL_WEBLINK');?>
                    </td>
                    <td>
                        <?php echo $this->weblink->weblink; ?>
                    </td>
                </tr>
                <tr>
                    <td class="key">
                        <?php echo JText::_('LABEL_AUTHOR');?>
                    </td>
                    <td>
                        <?php echo $this->weblink->author; ?>
                    </td>
                </tr>
                <tr>
                    <td class="key">
                        <?php echo JText::_('LABEL_DATE_SUBMITTED');?>
                    </td>
                    <td>
                        <?php echo $this->weblink->d_submitted; ?>
                    </td>
                </tr>
                <tr>
                    <td class="key">
                        <?php echo JText::_('LABEL_DESCRIPTION');?>
                    </td>
                    <td>
                        <?php echo $this->weblink->description; ?>
                    </td>
                </tr>
                <tr>
                    <td class="key">
                        <?php echo JText::_('LABEL_REMARKS');?>
                    </td>
                    <td>
                        <?php echo $this->weblink->remarks; ?>
                    </td>
                </tr>
            </table>
            </fieldset>
        </td>
    </tr>
    <tr>
        <td width="100%">
            <fieldset class="adminform">
            <legend><?php echo JText::_( 'RELATED_WEBLINKS' ); ?></legend>
            <table class="adminlist" width="100%">
                <thead>
                    <tr>
                        <th width="5">
                            <?php echo JText::_( 'Num' ); ?>
                        </th>
                        <th class="title">
                            <?php echo JText::_('LABEL_WEBLINK'); ?>
                        </th>
                        <th width="5%" class="title">
                            <?php echo JText::_('LABEL_STATUS'); ?>
                        </th>
                        <th width="10%" class="title">
                            <?php echo JText::_('LABEL_AUTHOR'); ?>
                        </th>
                        <th class="title" width="20%">
                            <?php echo JText::_('LABEL_DATE_SUBMITTED'); ?>
                        </th>
                        <th width="20%" class="title">
                            <?php echo JText::_('LABEL_DESCRIPTION'); ?>
                        </th>
                        <th width="20%" class="title">
                            <?php echo JText::_('LABEL_REMARKS'); ?>
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    if($this->related){
                        $k = 0;
                        $i = 0;
                        $user =& JFactory::getUser();
                        foreach ($this->related as $row){
                            ?>
                            <tr class="<?php echo "row$k"; ?>">
                                <td align="left">
                                    <?php echo $i++; ?>
                                </td>
                                <td align="left">
                                    <?php echo $row->weblink; ?>
                                </td>
                                <td>
                                    <?php
                                        if($row->status == 1){
                                            $img = 'published.png';
                                            $alt = 'LABEL_APPROVED';
                                        }else if($row->status == 2){
                                            $img = 'rejected.png';
                                            $alt = 'LABEL_REJECTED';
                                        }else{
                                            $img = 'pending.png';
                                            $alt = 'LABEL_PENDING';
                                        }
                                     ?>
                                    <img
                                        src="components/com_articlecashrewards/assets/images/<?php echo $img; ?>"
                                        border="0" title="<?php echo JText::_( $alt ); ?>"
                                        alt="<?php echo JText::_( $alt ); ?>" />
                                </td>
                                <td align="left">
                                    <?php echo $row->author; ?>
                                </td>
                                <td align="left">
                                    <?php echo $row->d_submitted; ?>
                                </td>
                                <td align="left">
                                    <?php echo $row->description; ?>
                                </td>
                                <td align="left">
                                    <?php echo $row->remarks; ?>
                                </td>
                            </tr>
                            <?php
                            $k = 1 - $k;
                        }
                    }
                    ?>
                </tbody>
            </table>
            </fieldset>
        </td>
    </tr>
</table>
<input type="hidden" name="option" value="com_articlecashrewards" />
<input type="hidden" name="controller" value="weblinks" />
<input type="hidden" name="task" value="review" />
<input type="hidden" name="redirect" value="<?php echo $this->redirect; ?>" />
<input type="hidden" name="cid" value="<?php echo $this->weblink->id; ?>" />
<input type="hidden" name="boxchecked" value="0" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
